2008 California Oil Spills

Spatial analysis of oil spills in CA.

Unknown
2021-02-22

This analysis uses data from the California Department of Fish and Game, Office of Spill Prevention and Response’s Oil Spill Incident Tracking. This analysis focuses on 2008 oil spill data.

hide
ca_counties <- read_sf(here("data", "project-01", "ca_counties", "CA_Counties_TIGER2016.shp")) %>%  clean_names()

oil_spills <- read_sf(here("data", "project-01", "ds394.shp")) %>% clean_names()

# Create subset of ca_counties to just have name and location
ca_subset <- ca_counties %>% 
  select(name)

2008 Oil Spills in California

hide
# Check CRS

# st_crs(ca_subset) #WGS 84
# st_crs(oil_spills) # NAD 83

# Change crs of oil_spills data
oil_spills <- st_transform(oil_spills, 3857)

# Check CRS
# st_crs(oil_spills)
hide
# Create maps

# Set the viewing mode to "interactive"
tmap_mode(mode = "view")

# Then make a map
tm_shape(ca_subset) +
  tm_fill("#5C5992")+ 
  tm_shape(oil_spills) +
  tm_dots('#14191F')

Figure 1. Map of 2008 oil spills in California (black dots). Data: California Department of Fish and Game, Office of Spill Prevention and Response (2009)

Inland oil spills by California county

hide
# Filter oil spills to only have inland spills

oil_spills_inland <- oil_spills %>% 
  filter(inlandmari == "Inland")

# Get counts of oil spills by counties

county_spills <- ca_subset %>% 
  st_join(oil_spills_inland)
hide
oil_spills_counts <- county_spills %>% 
  count(name)

ggplot(data = oil_spills_counts) +
  geom_sf(aes(fill = n), color = "white", size = 0.1) +
  scale_fill_gradientn(colors = c('#F0D77B','#5C5992','#14191F')) +
  theme_minimal() +
  labs(fill = "Inland Oil Spill Count",
       x = "longitude",
       y = "latitude")

Figure 2. 2008 inland oil spill count for California counties. Data: California Department of Fish and Game, Office of Spill Prevention and Response (2009)

Citation: California Department of Fish and Game, Office of Spill Prevention and Response (2009). 2008 Oil Spill Incident Tracking. Accessed here: https://map.dfg.ca.gov/metadata/ds0394.html#ID0EUGA